package com.buba.system.controller;


import com.buba.pojo.system.Health;
import com.buba.system.service.HealthService;
import com.buba.utils.R;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 健康百科表 前端控制器
 * </p>
 *
 * @author testjava
 * @since 2022-06-09
 */
@RestController
@RequestMapping("/system/health")
public class HealthController {

    @Autowired
    private HealthService healthService;

    /**
     * @Author 梁玉杰
     * @Description //所有健康百科列表
     * @param Health health
     * @Return com.buba.utils.R
     * @throws
     * @Date 2022/6/10 16:00
     **/
    @ApiOperation(value = "所有健康百科列表")
    @PostMapping("/findAllHealth")
    public R findAllHealth(@RequestBody(required = false) Health health) {
        return healthService.findAllHealth(health);
    }

    /**
     * @Author 梁玉杰
     * @Description //健康百科详情
     * @param Integer id
     * @Return com.buba.utils.R
     * @throws
     * @Date 2022/6/10 16:06
     **/
    @ApiOperation(value = "健康百科详情")
    @GetMapping("/findByHealthID/{id}")
    public R findByHealthID(@ApiParam(name = "id", value = "健康百科表的ID", required = true)
                                 @PathVariable Integer id) {
        return healthService.findByHealthID(id);
    }



}

